from pms.common.views import PostFormula
from user.models import User
from project.models import Project
from project.utils.profile import member_view


class API(PostFormula):
    def handle(self, req):
        uid = req['uid']
        pid = req['pid']
        user = User.objects.get(id=uid)
        project = Project.objects.get(id=pid)
        return self.success_respond(member_view(project, user))
